package com.zkteco.biosecurity.${moduleName}.controller;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.bind.annotation.PostMapping;


import com.zkteco.biosecurity.common.controller.CommonController;
import com.zkteco.biosecurity.common.util.Message;
import com.zkteco.biosecurity.${moduleName}.biz.service.${modelName?cap_first}Service;

/**
 * 
 * @author by code creator
 * @create ${createTime}
 * @since 1.0
 * @see
 */
@Controller
@Scope("prototype")
@RequestMapping("/${moduleName}/${requestMapping}")
public class ${modelName?cap_first}Controller extends CommonController {
	@Autowired
	private ${modelName?cap_first}Service ${modelName?uncap_first}Service;
	
	/**
	 * save entity
     * @param reqMsg
     * @return
     * @throws Exception
     */
    @PostMapping("/save")
    @ResponseBody
    public Message save(@RequestBody Message reqMsg) throws Exception {
        return ${modelName?uncap_first}Service.save(reqMsg);
    }

    /**
     * delete entity
     * @param reqMsg
     * @return
     */
    @PostMapping("/delete")
    @ResponseBody
    public Message del(@RequestBody Message reqMsg) {
    	return ${modelName?uncap_first}Service.delete(reqMsg);
    }

	/**
	 * update entity
     * @param reqMsg
     * @return
     * @throws Exception
     */
    @PostMapping("/update")
    @ResponseBody
    public Message update(@RequestBody Message reqMsg) {
    	 return ${modelName?uncap_first}Service.update(reqMsg);
    }

	/**
	 * get entity
     * @param reqMsg
     * @return
     * @throws Exception
     */
    @PostMapping("/get")
    @ResponseBody
    public Message get(@RequestBody Message reqMsg) {
    	 return ${modelName?uncap_first}Service.findAll(reqMsg);
    }
}
